﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DoAn_QuanLyCafe.App_Code.BLL;

namespace DoAn_QuanLyCafe
{
    public partial class frmDangNhap : DevExpress.XtraEditors.XtraForm
    {
        private static string Id;
        private static string Pass;
        
     
        

        public string ID
        {
            get { return Id; }
        }
        public string pass
        {
            get { return Pass; }
        }

        public frmDangNhap()
        {
            InitializeComponent();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btnDangnhap_Click(object sender, EventArgs e)
        {
            Nhanvien nv = new Nhanvien(txtTaikhoan.Text.Trim(), txtMatkhau.Text.Trim());

            if (nv.checkLogin())
            {
                Id = txtTaikhoan.Text.Trim();
                Pass = txtMatkhau.Text.Trim();
                
                frmQuanLyCafe fr = new frmQuanLyCafe();
                fr.Show();
                this.Visible = false;
            }
            else
                MessageBox.Show("Tài khoản hoăc mật khẩu không đúng");
        }

        private void frmDangNhap_Load(object sender, EventArgs e)
        {
            this.MaximizeBox = false;
            this.MinimizeBox = false;
        }

      
    }
}